<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function login(){
				var _uname=uname.value;
				var _upwd=upwd.value;
				//1、创建xhr异步对象
				var xhr=new XMLHttpRequest();
				//2、打开链接
				xhr.open("GET",`/pro/v1/login/${_uname}&${_upwd}`,true);
				//3、发送请求
				xhr.onreadystatechange=function(){
					if(xhr.readyState==4&&xhr.status==200){
						var r=xhr.responseText;
						d1.innerHTML=r;
					}
				}
				//4、接收响应
				xhr.send();
			}
		</script>
	</head>
	<body>
		<input type="text" id="uname"><br>
		<input type="text" id="upwd"><br>
		<button onclick="login()">登录</button>
		<div id="d1">
			
		</div>
	</body>
</html>
